define(function (require, exports, module) {
  const baseRestUrl =
    "https://www.fastmock.site/mock/cba803b6beae76d037e15cd339fdc8f8/dbtz";
  const { axios } = require("axios");

  const request = axios.create({
    baseURL: baseRestUrl + "/api",
    timeout: 6000,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });

  module.exports = {
    get(url, params = {}, path = {}) {
      return request.get(url, { params, ...path });
    },
    post(url, params = {}) {
      return request.post(url, params);
    },
    put(url, params = {}) {
      return request.put(url, params);
    },
    patch(url, params = {}) {
      return request.patch(url, params);
    },
    delete(url, params = {}, path = {}) {
      return request.delete(url, { params, ...path });
    },
  };
});
